﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Labb2
{
    class Camera
    {
        int m_resolutionX;
        int m_resolutionY;

        public Vector2 Resolution { get { return new Vector2(m_resolutionX, m_resolutionY); } }

        public Camera(int resolutionX, int resolutionY) 
        {
            m_resolutionX = resolutionX;
            m_resolutionY = resolutionY;
        }

        public Vector2 GetVisualCoords(Vector2 logicalVector) 
        {
            float visualX = logicalVector.X * ((float)m_resolutionX);
            float visualY = logicalVector.Y * ((float)m_resolutionY);

            return new Vector2(visualX, visualY);
        }

        public Vector2 GetLogicalCoords(Vector2 visualVector)
        {
            float logicalX = visualVector.X / (float)m_resolutionX;
            float logicalY = visualVector.Y / (float)m_resolutionY;

            return new Vector2(logicalX, logicalY);
        }

        //public float GetScale(float logicalCoord) 
        //{
        //    return logicalCoord * res
        //}
    }
}
